<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>基本资料</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/admin/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/css/public.css" media="all">
    <style>
        .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <div class="layui-form layuimini-form">
            <div class="layui-form-item">
                <!-- 隐藏input 传输id -->
                <input type="hidden" th:value="${session.EMPLOYEE.employeeId}" name="employeeId">
                <label class="layui-form-label required">性别</label>
                <div class="layui-input-block">
                    <select name="employeeSex" lay-filter="sex">
                        <option value="男" th:checked="${session.EMPLOYEE.employeeSex == '男'} ? 'true' : 'false' ">男</option>
                        <option value="女" th:checked="${session.EMPLOYEE.employeeSex == '女'} ? 'true' : 'false' ">女</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">手机</label>
                <div class="layui-input-block">
                    <input type="number" name="employeeTel" lay-verify="required" lay-reqtext="手机不能为空" placeholder="请输入手机"  th:value="${session.EMPLOYEE.employeeTel}" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-block">
                    <input type="email" name="email"  placeholder="请输入邮箱"  th:value="${session.EMPLOYEE.email}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/static/admin/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="/static/admin/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    layui.use(['form','miniTab','jquery'], function () {
        var form = layui.form,
            layer = layui.layer,
            miniTab = layui.miniTab;
        var $ = layui.jquery;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            console.log(data.field);
            data.field.verify = 1;
            $.ajax({
                url:'/admin/updateEmployeeByEmpId',
                type:'post',
                data:data.field,
                dataType:'json',
                success:function (res) {
                    if (res.data > 0){

                    }
                    layer.msg(res.message);
                }
            })

            return false;
        });

    });
</script>
</body>
</html>
